package com.qsmx.store.app.main.mem;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.qsmx.store.app.R;
import com.qsmx.store.app.R2;
import com.qsmx.store.app.main.mem.adapter.MemCardManagerImportantAdapter;
import com.qsmx.store.core.delegates.AtmosDelegate;

import java.util.List;

import butterknife.BindView;

public class MemCardManagerImportantDelegate extends AtmosDelegate {

    private MemCardManagerImportantAdapter mAdapter;
    private List<String> mData;

    @BindView(R2.id.rlv_important_check)
    RecyclerView rlvImportantCheck;

    @Override
    public Object setLayout() {
        return R.layout.delegate_mem_card_manager_important_info;
    }

    @Override
    public void onBindView(@Nullable Bundle savedInstanceState, View rootView) {

        initData();
        initRecycler();

    }

    private void initData() {

        mData.add("暂停消费");
        mData.add("暂停礼品兑换");
        mData.add("暂停存票");
        mData.add("暂停存币");
        mData.add("暂停送币");
        mData.add("暂停投币");
        mData.add("暂停售币");
        mData.add("暂停过户");
        mData.add("暂停提币");
    }

    private void initRecycler() {

        mAdapter = new MemCardManagerImportantAdapter(getContext());
        GridLayoutManager manager = new GridLayoutManager(getContext(), 2);

        rlvImportantCheck.setAdapter(mAdapter);
        rlvImportantCheck.setLayoutManager(manager);

        mAdapter.setData(mData);
        mAdapter.notifyDataSetChanged();

    }
}
